package com.controller;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import com.entity.Pay;
import com.service.PayService;

@Controller
@RequestMapping("/paycontroller")
public class PayController {
	
	@Resource
	PayService payService;
	
	@RequestMapping("/show")
	public String show(String address,ModelMap map) throws Exception{
		String addr = new String(address.getBytes("ISO-8859-1") , "utf-8");
		List<Pay> list=payService.show(addr);
		double total=0.00;
		for(Pay p:list){
			total=p.getMoeny()*0.01+total;
			double moeny=p.getMoeny()*0.01;
			p.setMoeny(moeny);
		}
		map.addAttribute("list", list);
		map.addAttribute("total", total);
		return "showpayrecord";
	}
}
